package com.wm.wmcrm.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wm.wmcrm.common.util.PageUtils;
import com.wm.wmcrm.sys.entity.SysLog;
import com.wm.wmcrm.sys.mapper.SysLogMapper;
import com.wm.wmcrm.sys.model.SysLogQueryDTO;
import com.wm.wmcrm.sys.model.SysRoleQueryDTO;
import com.wm.wmcrm.sys.service.ISysLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统日志 服务实现类
 * </p>
 *
 * @author wm
 * @since 2023-02-24
 */
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements ISysLogService {

    @Override
    public PageUtils queryList(SysLogQueryDTO queryDTO) {
        LambdaQueryWrapper<SysLog> queryWrapper = new LambdaQueryWrapper<SysLog>().like(
                StringUtils.isNotEmpty(queryDTO.getOperation()),SysLog::getOperation,queryDTO.getOperation()
        );
        Page<SysLog> page = this.page(queryDTO.page(),queryWrapper);
        return new PageUtils(page);
    }
}
